package com.ztools.pc.service.information;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ztools.common.model.pc.information.WeChatMember;
import com.ztools.common.util.common.PageUtil;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * @Author:seeTools
 * @Date: 2023/4/14  20:20
 * @Version 1.0
 */
public interface MemberService extends IService<WeChatMember> {


    /**
     * 分页查询
     *
     * @param pageUtil pageUtil
     * @return WeChatMember
     */
    Page<WeChatMember> findList(PageUtil<WeChatMember> pageUtil);

    /**
     * 添加
     *
     * @param weChatMember student
     * @return boolean
     */
    boolean add(WeChatMember weChatMember);

    /**
     * 删除
     *
     * @param weChatMember weChatMember
     * @return boolean
     */
    boolean delete(WeChatMember weChatMember);

    /**
     * 根据条件查询
     *
     * @param weChatMember weChatMember
     * @return WeChatMember
     */
    List<WeChatMember> findByObject(WeChatMember weChatMember);

    /**
     * 更具openId获取数据
     *
     * @param openId openId
     * @return WeChatMember
     */
    WeChatMember findByOpenId(String openId);

    /**
     * 修改
     *
     * @param weChatMember weChatMember
     * @return boolean
     */
    boolean update(WeChatMember weChatMember);

    /**
     * 更新会员昵称
     *
     * @param memberId memberId
     * @param nickName nickName
     */
    void updateNickName(Long memberId, String nickName);

    /**
     * 根据字段查询数据
     *
     * @param fieldName 字段名称
     * @param value     值
     * @return WeChatMember
     */
    List<WeChatMember> findBy(String fieldName, Object value);

    /**
     * 导出
     *
     * @param response     response
     * @param weChatMember weChatMember
     */
    void exportExcel(HttpServletResponse response, WeChatMember weChatMember);
}
